function check() {

	var nameObj = document.getElementById("operatorName");
	var pwdObj = document.getElementById("operatorPass");
	var codeObj = document.getElementById("code");

	var name = nameObj.value;
	var pwd = pwdObj.value;
	var code = codeObj.value;

	if ("" == name) {
		alert("用户名空");
		document.getElementById("operatorName").focus();
	} else if ("" == pwd) {
		alert("密码空");
		document.getElementById("operatorPass").focus();
	} else if ("" == code) {
		alert("验证码空");
		document.getElementById("code").focus();
	} else {
		var url = "/stock/login.do?operatorName=" + name
				+ "&operatorPass=" + pwd + "&code=" + code;
		$.post(url, null, function(data) {
					if ("" != data) {
						alert(data);
					} else {
						window.location = "/stock/pages/PaladinStock.jsp";
					}
				});
	}
}

function login() {
	if (event.keyCode == 13) {
		check();
	}
}